RemoveAt

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Removes the value at an index in a JSONArray and returns True or False to indicate if it was successfully removed. The remaining values in the JSONArray move up one index.

Syntax

RemoveAt(Index)

Arguments

Argument Description
Index Index to remove in the JSONArray. JSONArray indexes are zero based.

Supported objects

JSONArray

Return value

Value Description
True Index was removed.
False Index was not removed.

Example

jsonArray = JSONNewArray()

' Appends 1 and 2 to end of array

jsonArray.Push(1)

jsonArray.Push(2)

' Appends 3 to end of array

jsonArray.SetValue(2, 3)

' Removes second entry in array and returns True

boolVal = jsonArray.RemoveAt(1)

PrintLn("Should be True: " & boolVal)

' Fails to remove 100th entry in array and returns False

boolVal = jsonArray.RemoveAt(99)

PrintLn("Should be False: " & boolVal)